package com.wd.live.view.fragment

import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.fragment.app.Fragment
import androidx.recyclerview.widget.GridLayoutManager
import androidx.recyclerview.widget.RecyclerView
import com.wd.live.R
import com.wd.live.model.bean.StartBean
import com.wd.live.view.adapter.SexRecyViewAdpater


class Sex1Fragment : Fragment() {
    private var sex1Recyid: RecyclerView? = null
    private val list: MutableList<StartBean> = ArrayList()
    private var adpater: SexRecyViewAdpater? = null
    override fun onCreateView(
        inflater: LayoutInflater, container: ViewGroup?,
        savedInstanceState: Bundle?
    ): View? {
        val view = inflater.inflate(R.layout.fragment_sex1, container, false)
        initView(view)
        return view
    }

    override fun onActivityCreated(savedInstanceState: Bundle?) {
        super.onActivityCreated(savedInstanceState)
        list.add(StartBean(R.mipmap.ss1, R.mipmap.s1, false))
        list.add(StartBean(R.mipmap.ss2, R.mipmap.s2, false))
        list.add(StartBean(R.mipmap.ss3, R.mipmap.s3, false))
        list.add(StartBean(R.mipmap.ss4, R.mipmap.s4, false))
        list.add(StartBean(R.mipmap.ss5, R.mipmap.s5, false))
        list.add(StartBean(R.mipmap.ss6, R.mipmap.s6, false))
        list.add(StartBean(R.mipmap.ss7, R.mipmap.s7, false))
        list.add(StartBean(R.mipmap.ss8, R.mipmap.s8, false))
        list.add(StartBean(R.mipmap.ss9, R.mipmap.s9, false))
        list.add(StartBean(R.mipmap.ss10, R.mipmap.s10, false))
        list.add(StartBean(R.mipmap.ss11, R.mipmap.s11, false))
        list.add(StartBean(R.mipmap.ss12, R.mipmap.s12, false))
        adpater = SexRecyViewAdpater(requireActivity(), list)
        sex1Recyid!!.layoutManager = GridLayoutManager(activity, 3)
        sex1Recyid!!.adapter = adpater
    }

    private fun initView(view: View) {
        sex1Recyid = view.findViewById(R.id.sex1_recyid)
    }

}